package com.qf.rabbitmq2203.sendmessage;

import com.qf.rabbitmq2203.constants.Constants;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/message")
public class Send {

    @Autowired
    RabbitTemplate rabbitTemplate;

    @RequestMapping("/send")
    public void sendMessage(){

        rabbitTemplate.convertAndSend(Constants.ExchangeA,"big.ORANGE.cat","发送消息");
    }
}
